﻿<?php

class Application_Form_Categorie extends Application_Form_InlineForm {

    public function init() {
		
		$this->setAttrib('id', 'formcategorie');
		
		$idcategorie = new Zend_Form_Element_Hidden('idcategorie',array(
		 'decorators' => $this->getElementDecoratorHidden()
		));
	
		$actioncategorie = new Zend_Form_Element_Hidden('actioncategorie',array(
		 'decorators' => $this->getElementDecoratorHidden()
		));
			
        $nomcategorie = new Zend_Form_Element_Text('nomcategorie', array(
                    'label' => 'Nom :',
                    'required' => true,
                    'filters' => array('StringTrim'),
                    'validators' => array(
                        array('NotEmpty', true),
						array('StringLength', true, array('max'=>50))
                    ),
                    'decorators' => $this->getElementDecorators()
                ));
		
		$photo = new Zend_Form_Element_Hidden('photo',array(
		 'decorators' => $this->getElementDecoratorHidden()
		));
		
		$extension = new Zend_Form_Element_Hidden('extension',array(
				'decorators' => $this->getElementDecoratorHidden()
		));

		$uploadphoto =  new Zend_Form_Element_Text('uploadphoto', array(
                    'required' => true,
                    'filters' => array('StringTrim'),
                    'validators' => array(
                        array('NotEmpty', true),
						array('StringLength', true, array('max'=>50))
                    ),
                    'decorators' => $this->getElementDecorators(),
					'name' =>'file_upload'
         ));

        $this->addElements(array($idcategorie,$actioncategorie,$nomcategorie,$uploadphoto, $extension, $photo));
    }
}